<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2025/8/7
  Time: 15:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
      integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
      integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1">
<html>
<head>
    <title>Title</title>
    <!-- 必须的 meta 标签 -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap 的 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
          integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">

</head>
<body>
<form action="/jsp_war/updateBrandServlet" method="post">
    <!-- 添加隐藏的ID字段 -->
    <input type="hidden" name="id" value="${brand.id}">
    <div class="mb-3">
        <label for="exampleFormControlInput1" class="form-label">品牌名称</label>
        <input type="text" class="form-control" id="exampleFormControlInput1" value="${brand.brandName}" name="brandName">
    </div>
    <div class="mb-3">
        <label for="exampleFormControlInput1" class="form-label">企业名称</label>
        <input type="text" class="form-control" id="exampleFormControlInput2" value="${brand.companyName}" name="companyName">
    </div>
    <div class="mb-3">
        <label for="exampleFormControlInput1" class="form-label">排序</label>
        <input type="text" class="form-control" id="exampleFormControlInput3" value="${brand.ordered}" name="ordered">
    </div>
    <div class="mb-3">
        <label for="exampleFormControlTextarea1" class="form-label">品牌介绍</label>
        <textarea class="form-control" id="exampleFormControlTextarea1" rows="3"  name="description">${brand.description}</textarea>
    </div>
    <c:if test="${brand.status == 1}" >
    <div class="form-check form-switch" style="margin-left: 20px">
        <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked1" name="status" value="1" checked>
        <label class="form-check-label" for="flexSwitchCheckChecked1" >启用</label>
    </div>
    <div class="form-check form-switch" style="margin-left: 20px">
        <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked2" name="status" value="0" >
        <label class="form-check-label" for="flexSwitchCheckChecked2"  >禁用</label>
    </div>
    </c:if>:
    <c:if test="${brand.status == 0}" >
        <div class="form-check form-switch" style="margin-left: 20px">
            <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked3" name="status" value="1" >
            <label class="form-check-label" for="flexSwitchCheckChecked1" >启用</label>
        </div>
        <div class="form-check form-switch" style="margin-left: 20px">
            <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked4" name="status" value="0" checked>
            <label class="form-check-label" for="flexSwitchCheckChecked2"  >禁用</label>
        </div>
    </c:if>:
    <button type="submit" class="btn btn-dark">提交</button>
</form>
</body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
        integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
        crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-7ymO4nGrkm372HoSbq1OY2DP4pEZnMiA+E0F3zPr+JQQtQ82gQ1HPY3QIVtztVua"
        crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-/mhDoLbDldZc3qpsJHpLogda//BVZbgYuw6kof4u2FrCedxOtgRZDTHgHUhOCVim"
        crossorigin="anonymous"></script>

</html>
